
require('@/js/publiclayouts.js')

require('./index.styl')
require('./layouts/detailnav.styl')
require('./layouts/detailbuy.styl')
require('./layouts/detailbuy.js')

import $ from 'jquery'

import {showelIfmouseEnterEls} from '@/js/myloadsh.js'

var menu_html = require('html-loader!../commonlayouts/menu.html')

var nav_item_all_content = $('.nav-item-all-content');

nav_item_all_content.html(menu_html);

showelIfmouseEnterEls('.public-menu',['.nav-item-all','.public-menu']);


$("#nav-close").on("click",function(){
    $(".login-nav").css("height","0");
})


var detailmaintabs = document.querySelectorAll('.detail-tab-title');
console.log(detailmaintabs);
var tabcontents = document.querySelectorAll('.detail-tab-content');
for(let i = 0; i < detailmaintabs.length; i += 1) {
    let tab = detailmaintabs[i];
    tab.addEventListener('click', () => {
        for(let t of detailmaintabs) {
            $(t).removeClass('themecolor');
        }
        $(detailmaintabs[i]).addClass('themecolor');
        for(let tabcontent of tabcontents) {
            $(tabcontent).removeClass('active');
        }
        $(tabcontents[i]).addClass('active');
    })
}